#!/bin/bash

# 设置工作目录
WORKDIR=/workspace
cd $WORKDIR

# 复制必要的文件
cp setup.py $WORKDIR/
cp setup.cfg $WORKDIR/
cp requirements.txt $WORKDIR/
cp MANIFEST.in $WORKDIR/
cp README.md $WORKDIR/

# 创建requirements目录并复制build.txt
mkdir -p $WORKDIR/requirements
cp requirements/build.txt $WORKDIR/requirements/

# 安装MMCV
pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.1/index.html

# 安装项目依赖
pip install -r requirements/build.txt
pip install -v -e .

# 安装其他依赖
conda clean --all
pip install numpy==1.20 cython opencv-python scipy timm yapf==0.40.1

# 设置环境变量
echo "export PYTHONPATH=$WORKDIR:$PYTHONPATH" >> ~/.bashrc 